package cn.org.zx.db.dbconnection;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class DBProperties {
	private static Properties properties;
	private static final DBProperties dbproperties = new DBProperties();
	/**
	 * 
	 * 构造函数加载文件
	 * 
	 */
	private DBProperties()
	{
		InputStream is = getClass().getResourceAsStream("/DBConfig.properties"); 
		properties = new Properties();
		try
		{
			properties.load(is);
		}
		catch (IOException ex)
		{
			ex.printStackTrace();
		}
	}
	
	/**根据页面ID取页面地址
	 * @param pageid 页面ID
	 * @return
	 */
	public static String getDBType()
	{
		return dbproperties.properties.getProperty("dbtype"); 
	}
	
	//存放上传文件路径
	public static String getPathFile()
	{
		return dbproperties.properties.getProperty("pathfile"); 
	}
	
	//获取静态页面存放路径
	public static String getHtmlFilePath()
	{
		return dbproperties.properties.getProperty("htmlfilepath"); 
	}
	
	//获取静态页面存放相对路径
	public static String getWebHtmlFilePath()
	{
		return dbproperties.properties.getProperty("webhtmlfilepath"); 
	}
	
	//获取URL路径
	public static String getURL()
	{
		return dbproperties.properties.getProperty("url"); 
	}
	
	//FTP
	public static String getFtpHome()
	{
		return dbproperties.properties.getProperty("ftphome"); 
	}
	//FTP
	public static String getFtpPort()
	{
		return dbproperties.properties.getProperty("ftpport"); 
	}
	//FTP
	public static String getFtpUser()
	{
		return dbproperties.properties.getProperty("ftpuser"); 
	}
	//FTP
	public static String getFtpPassword()
	{
		return dbproperties.properties.getProperty("ftppassword"); 
	}	
}
